package com.zmc.lostfound.common.constant;

/**
 * @author zmc
 * @description 正则表达式常量池
 */
public class RegexConstant {

    /**
     * 手机号
     */
    public static final String PHONE_REGEX = "^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\\d{8}$";

    /**
     * 手机号前三位 + [0, 8]位数字
     */
    public static final String PHONE_PREFIX_REGEX = "^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\\d{0,8}$";

    /**
     * 邮箱
     */
    public static final String EMAIL_REGEX = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";

    /**
     * 密码: 6~18个字符，至少包含1个字母、1个数字、1个特殊字符
     */
    public static final String PASSWORD_REGEX = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@_$!%*#?&])[A-Za-z\\d$@_$!%*#?&]{6,18}$";

    /**
     * 验证码: 6位数字
     */
    public static final String CAPTCHA_REGEX = "^\\d{6}$";

    /**
     * 数字
     */
    public static final String NUM_REGEX = "^[0-9]*$";

    /**
     * 不含中文的字符串
     */
    public static final String NOT_CHINESE_REGEX = "^[^\\u4e00-\\u9fa5]+$";

}
